package com.sskj.b70.m;

import android.text.TextUtils;

import com.sskj.b70.utils.NumberUtil;

import java.math.BigDecimal;

/**
 * 作者 :吕志豪
 * 简书：https://www.jianshu.com/u/6e525b929aac
 * github：https://github.com/lvzhihao100
 * 描述：
 * 创建时间：2018-07-30 10:28
 */
public class StockCoinBean {

    /**
     * buyMin (number, optional): 最小购买数量 ,
     * category (string, optional): 所属行业 ,
     * children (object, optional): 风控统计 ,
     * code (string, optional): 代码 ,
     * coinOutType (string, optional): 1:默认 2:自选 ,
     * coinType (string, optional): 币种类型(1-以太坊;2-比特币) ,
     * contractMax (integer, optional): 最大合约数 ,
     * contractMin (integer, optional): 最小合约数 ,
     * createTime (string, optional): 创建时间 ,
     * currentPrice (string, optional): 现价 ,
     * dealEndTime (string, optional): 交易结束时间 ,
     * dealFee (number, optional): 每手交易手续费 固定美金 手续费比例 百分比 ,
     * dealStartTime (string, optional): 交易开始时间 ,
     * deleted (boolean, optional),
     * engname (string, optional): 英文名称 ,
     * floatMoney (number, optional): 点位波动差值 默认1美元 ,
     * goingLongStatus (boolean, optional): 做多状态：0:允许 1:禁止 ,
     * id (integer, optional),
     * lever (number, optional): 杠杆 ,
     * lotSize (integer, optional): 每手股数 主要针对港股，美股每手1股 ,
     * marginFee (number, optional): 每手保证金 ,
     * market (string, optional): 上市地 ,
     * name (string, optional): 名称 ,
     * overNightFee (number, optional): 每手递延费（过夜费） ,
     * productContract (string, optional): 产品合约列表 ,
     * productFloatMoney (string, optional): 产品点值 ,
     * publishNum (number, optional): 发行数量 ,
     * publishPrice (number, optional): 发行单价 ,
     * publishTime (string, optional): 发行日期 ,
     * publishWeb (string, optional): 发行网站 ,
     * remark (string, optional): 简介 ,
     * shortSellingStatus (boolean, optional): 做空状态：0:允许 1:禁止 ,
     * slidingScalePrice (number, optional): 最小浮动价格 ,
     * spread (number, optional): 点差 ,
     * stopLoss (number, optional): 止损点数 ,
     * stopProfit (number, optional): 止盈点数 ,
     * timestamp (string, optional),
     * type (string, optional): 股票类型 1:A股 2:港股 3:美股 4:商品 5:期货 注：区块链项目用商品4 ,
     * upDownStatus (boolean, optional): 上架下架状态 0:正常上架 1:下架 ,
     * whitePaper (string, optional): 白皮书
     */

    private int type;
    private String name;
    private String code;
    private String engname;
    private String category;
    private String market;
    private double slidingScalePrice;
    private double floatMoney;
    private double lotSize;
    private double marginFee;
    private double dealFee;
    private String overNightFee;
    private double spread;
    private double stopProfit;
    private double stopLoss;
    private double minStopProfit;
    private double minStopLoss;
    private double contractMax;
    private double contractMin;
    private boolean goingLongStatus;
    private boolean shortSellingStatus;
    private String upDownStatus;
    private String dealStartTime;
    private String dealEndTime;
    private String createTime;
    private String timestamp;
    private String productFloatMoney;
    private String lever;
    private double buyMin;
    private String publishTime;
    private String publishNum;
    private String publishPrice;
    private String publishWeb;
    private String whitePaper;
    private String coinType;
    private String coinOutType;
    private String remark;
    private StockProductVOBean stockProductVO;
    private String deleted;

    public double getMinStopProfit() {
        return minStopProfit;
    }

    public void setMinStopProfit(double minStopProfit) {
        this.minStopProfit = minStopProfit;
    }

    public double getMinStopLoss() {
        return minStopLoss;
    }

    public void setMinStopLoss(double minStopLoss) {
        this.minStopLoss = minStopLoss;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getEngname() {
        return engname;
    }

    public void setEngname(String engname) {
        this.engname = engname;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getMarket() {
        return market;
    }

    public void setMarket(String market) {
        this.market = market;
    }

    public double getSlidingScalePrice() {
        return slidingScalePrice;
    }

    public void setSlidingScalePrice(double slidingScalePrice) {
        this.slidingScalePrice = slidingScalePrice;
    }

    public double getFloatMoney() {
        return floatMoney;
    }

    public void setFloatMoney(double floatMoney) {
        this.floatMoney = floatMoney;
    }

    public double getLotSize() {
        return lotSize;
    }

    public void setLotSize(double lotSize) {
        this.lotSize = lotSize;
    }

    public double getMarginFee() {
        return marginFee;
    }

    public void setMarginFee(double marginFee) {
        this.marginFee = marginFee;
    }

    public double getDealFee() {
        return dealFee;
    }

    public void setDealFee(double dealFee) {
        this.dealFee = dealFee;
    }

    public String getOverNightFee() {
        return overNightFee;
    }

    public void setOverNightFee(String overNightFee) {
        this.overNightFee = overNightFee;
    }

    public double getSpread() {
        return spread;
    }

    public void setSpread(double spread) {
        this.spread = spread;
    }

    public double getStopProfit() {
        return stopProfit;
    }

    public void setStopProfit(double stopProfit) {
        this.stopProfit = stopProfit;
    }

    public double getStopLoss() {
        return stopLoss;
    }

    public void setStopLoss(double stopLoss) {
        this.stopLoss = stopLoss;
    }

    public double getContractMax() {
        return contractMax;
    }

    public void setContractMax(double contractMax) {
        this.contractMax = contractMax;
    }

    public double getContractMin() {
        return contractMin;
    }

    public void setContractMin(double contractMin) {
        this.contractMin = contractMin;
    }

    public boolean isGoingLongStatus() {
        return goingLongStatus;
    }

    public void setGoingLongStatus(boolean goingLongStatus) {
        this.goingLongStatus = goingLongStatus;
    }

    public boolean isShortSellingStatus() {
        return shortSellingStatus;
    }

    public void setShortSellingStatus(boolean shortSellingStatus) {
        this.shortSellingStatus = shortSellingStatus;
    }

    public String getUpDownStatus() {
        return upDownStatus;
    }

    public void setUpDownStatus(String upDownStatus) {
        this.upDownStatus = upDownStatus;
    }

    public String getDealStartTime() {
        return dealStartTime;
    }

    public void setDealStartTime(String dealStartTime) {
        this.dealStartTime = dealStartTime;
    }

    public String getDealEndTime() {
        return dealEndTime;
    }

    public void setDealEndTime(String dealEndTime) {
        this.dealEndTime = dealEndTime;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getProductFloatMoney() {
        return productFloatMoney;
    }

    public void setProductFloatMoney(String productFloatMoney) {
        this.productFloatMoney = productFloatMoney;
    }

    public double getLever() {
        return TextUtils.isEmpty(lever) ? 0 : Double.valueOf(lever);
    }

    public void setLever(String lever) {
        this.lever = lever;
    }

    public double getBuyMin() {
        return buyMin;
    }

    public void setBuyMin(double buyMin) {
        this.buyMin = buyMin;
    }

    public String getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public String getPublishNum() {
        return publishNum;
    }

    public void setPublishNum(String publishNum) {
        this.publishNum = publishNum;
    }

    public String getPublishPrice() {
        return publishPrice;
    }

    public void setPublishPrice(String publishPrice) {
        this.publishPrice = publishPrice;
    }

    public String getPublishWeb() {
        return publishWeb;
    }

    public void setPublishWeb(String publishWeb) {
        this.publishWeb = publishWeb;
    }

    public String getWhitePaper() {
        return whitePaper;
    }

    public void setWhitePaper(String whitePaper) {
        this.whitePaper = whitePaper;
    }

    public String getCoinType() {
        return coinType;
    }

    public void setCoinType(String coinType) {
        this.coinType = coinType;
    }

    public String getCoinOutType() {
        return coinOutType;
    }

    public void setCoinOutType(String coinOutType) {
        this.coinOutType = coinOutType;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public StockProductVOBean getStockProductVO() {
        return stockProductVO;
    }

    public void setStockProductVO(StockProductVOBean stockProductVO) {
        this.stockProductVO = stockProductVO;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    public static class StockProductVOBean {

        /**
         * id : 65941
         * code : BTC/USDT
         * period :
         * volume : 1105.7990574
         * price :
         * openPrice : 7742.9811
         * closePrice : 7756.3033
         * prevClose :
         * high : 7771.7909
         * low : 7725.3701
         * date : 1533063600000
         * createTime :
         * isDeleted : 0
         * timestamp : 1533067500000
         * {"code":"BTC/USDT","name":"BTC/USDT","date":"2018-08-01","time":"18:58:21","price":"7567.9654","openPrice":"7954.7674","closePrice":"7567.9654","high":"8024.5139","low":"7469.1785","prevClose":"","volume":"42724","change":"-386.8020","changeRate":"-4.86%","buy":"7563.1015","sell":"7570.0456"}
         */

        private boolean isGreen;
        private boolean isLight;
        private int id;
        private String code;
        private String period;
        private double volume;
        private String price;
        private double openPrice;

        private double closePrice;
        private String prevClose;

        private double high;

        private double low;
        private String createTime;
        private int isDeleted;
        private String change;
        private String changeRate;
        private String sell;
        private String buy;
        /**
         * name : BCH/BTC
         * date : 2018-08-02
         * time : 21:53:30
         * openPrice : 0.10010991
         * closePrice : 0.09926790
         * high : 0.10172999
         * low : 0.09501000
         * volume : 28437
         */

        private String name;
        private String date;
        private String time;
        private String cnyPrice;//换算后的人民币

        public boolean isGreen() {
            return isGreen;
        }

        public void setGreen(boolean green) {
            isGreen = green;
        }

        public boolean isLight() {
            return isLight;
        }

        public void setLight(boolean light) {
            isLight = light;
        }

        public String getCnyPrice() {
            return NumberUtil.keepNoIn(cnyPrice, 2, false);
        }

        public void setCnyPrice(String cnyPrice) {
            this.cnyPrice = cnyPrice;
        }

        public String getSell() {
            return TextUtils.isEmpty(sell) ? "0" : sell;
        }

        public void setSell(String sell) {
            this.sell = sell;
        }

        public String getBuy() {
            return TextUtils.isEmpty(buy) ? "0": buy;
        }

        public void setBuy(String buy) {
            this.buy = buy;
        }

        public double getChange() {
            return TextUtils.isEmpty(change) ? 0 : new BigDecimal(change).doubleValue();
        }

        public void setChange(String change) {
            this.change = change;
        }

        public String getChangeRate() {
            return changeRate;
        }

        public void setChangeRate(String changeRate) {
            this.changeRate = changeRate;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getPeriod() {
            return period;
        }

        public void setPeriod(String period) {
            this.period = period;
        }

        public double getVolume() {
            return volume;
        }

        public void setVolume(double volume) {
            this.volume = volume;
        }

        public String getPrice() {
            return TextUtils.isEmpty(price) ? "0" : NumberUtil.keepNoZero(price);
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public double getOpenPrice() {
            return openPrice;
        }

        public void setOpenPrice(double openPrice) {
            this.openPrice = openPrice;
        }

        public double getClosePrice() {
            return closePrice;
        }

        public void setClosePrice(double closePrice) {
            this.closePrice = closePrice;
        }

        public String getPrevClose() {
            return prevClose;
        }

        public void setPrevClose(String prevClose) {
            this.prevClose = prevClose;
        }

        public double getHigh() {
            return new BigDecimal(NumberUtil.keepMax4(high)).doubleValue();
        }

        public void setHigh(double high) {
            this.high = high;
        }

        public double getLow() {
            return new BigDecimal(NumberUtil.keepMax4(low)).doubleValue();
        }

        public void setLow(double low) {
            this.low = low;
        }


        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public int getIsDeleted() {
            return isDeleted;
        }

        public void setIsDeleted(int isDeleted) {
            this.isDeleted = isDeleted;
        }



        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }
    }
}
